package cl.zeke.remoto.vista.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HolaMundoController {
    
    @RequestMapping("/holamundo")
    public @ResponseBody String  saludar() {
        return "Hola Mundo!";
    }
    
    @RequestMapping("/parametros/{var}/{var2}")
    public @ResponseBody String  saludar(
            @PathVariable("var") String var,
            @PathVariable("var2") String var2,
            @RequestParam("p1") String p1,
            @RequestParam("p2") String p2) {
        
        return "var: " + var + " var2:" +var2 + " p1:" + p1 + " p2:" + p2;
    }
    
    
}
